28. Coding up a crazy recursive sequence

Coding up a recursive sequence

The logistic recursive sequence is defined as

  • s_1 = \alpha
  • s_2 = ws_1 - ws_1^2
  • s_3 = ws_2 - ws_2^2
  • s_4 = ws_3 - ws_3^2
  • \cdots

Exercise

Do this in your own coding environment. Generate and plot the first 50 elements of this sequence when the following values are used:

  • s_1 = 0.5, w=1
  • s_1 = 0.5, w=3
  • s_1 = 0.0001, w=4.

Your plots should look as follows. Feel free to try other values, and see how the recursive sequence looks!